package com._119yn.host.gst200.api.host;

import com._119yn.host.gst200.service.DtuService;
import com._119yn.host.gst200.service.HostService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/host")
@RequiredArgsConstructor
public class HostController {

    private final DtuService dtuService;

    private final HostService hostService;

    @GetMapping("hostSilence")
    public void hostSilence(
            @RequestParam(value = "host", required = false)
            Integer host
    ) {
        hostService.hostSilence(host);
    }

    @GetMapping("hostReset")
    public void hostReset(
            @RequestParam(value = "host", required = false)
            Integer host
    ) {
        hostService.hostReset(host);
    }

    @GetMapping("hostManualForbid")
    public void hostManualForbid(
            @RequestParam(value = "host", required = false)
            Integer host
    ) {
        hostService.hostManualForbid(host);
    }

    @GetMapping("hostManualPermit")
    public void hostManualPermit(
            @RequestParam(value = "host", required = false)
            Integer host
    ) {
        hostService.hostManualPermit(host);
    }

    @GetMapping("hostAutoForbid")
    public void hostAutoForbid(
            @RequestParam(value = "host", required = false)
            Integer host
    ) {
        hostService.hostAutoForbid(host);
    }

    @GetMapping("hostAutoPartial")
    public void hostAutoPartial(
            @RequestParam(value = "host", required = false)
            Integer host
    ) {
        hostService.hostAutoPartial(host);
    }

    @GetMapping("hostAutoFull")
    public void hostAutoFull(
            @RequestParam(value = "host", required = false)
            Integer host
    ) {
        hostService.hostAutoFull(host);
    }

    @GetMapping("hostSprayForbid")
    public void hostSprayForbid(
            @RequestParam(value = "host", required = false)
            Integer host
    ) {
        hostService.hostSprayForbid(host);
    }

    @GetMapping("hostSprayPermit")
    public void hostSprayPermit(
            @RequestParam(value = "host", required = false)
            Integer host
    ) {
        hostService.hostSprayPermit(host);
    }

    @GetMapping("hostGuardDisable")
    public void hostGuardDisable(
            @RequestParam(value = "host", required = false)
            Integer host
    ) {
        hostService.hostGuardDisable(host);
    }

    @GetMapping("hostGuardEnable")
    public void hostGuardEnable(
            @RequestParam(value = "host", required = false)
            Integer host
    ) {
        hostService.hostGuardEnable(host);
    }

    @GetMapping("deviceStartup")
    public void deviceStartup(
            @RequestParam(value = "host", required = false)
            Integer host,
            @RequestParam(value = "devCode")
            int devCode,
            @RequestParam(value = "devType")
            int devType
    ) {
        hostService.deviceStartup(host, devCode, devType);
    }

    @GetMapping("deviceStartupStop")
    public void deviceStartupStop(
            @RequestParam(value = "host", required = false)
            Integer host,
            @RequestParam(value = "devCode")
            int devCode,
            @RequestParam(value = "devType")
            int devType

    ) {
        hostService.deviceStartupStop(host, devCode, devType);
    }

    @GetMapping("deviceShield")
    public void deviceShield(
            @RequestParam(value = "host", required = false)
            Integer host,
            @RequestParam(value = "devCode")
            int devCode,
            @RequestParam(value = "devType")
            int devType
    ) {
        hostService.deviceShield(host, devCode, devType);
    }

    @GetMapping("deviceShieldCancel")
    public void deviceShieldCancel(
            @RequestParam(value = "host", required = false)
            Integer host,
            @RequestParam(value = "devCode")
            int devCode,
            @RequestParam(value = "devType")
            int devType
    ) {
        hostService.deviceShieldCancel(host, devCode, devType);
    }

}
